var gulp = require('gulp');
var sass = require('gulp-sass');
var handleErrors = require('../util/handleErrors');
var config=require('../config').sass;
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');

gulp.task('sass', ['images'], function () {
  return gulp.src(config.app)
    .pipe(sass())
    .on('error', handleErrors)
    .pipe(gulp.dest(config.dest))

    .pipe(minifyCss({
      keepSpecialComments: 0
    }))
    .pipe(rename({ extname: '.min.css' }))
    .pipe(gulp.dest(config.dest));
});
